<template>
  <view>
    <view class="gui-margin-top">
      <gui-article-list :articles="articleList" @newstap="newstap" :baseUrl="baseUrl"></gui-article-list>
    </view>
  </view>
</template>

<script>
  // import bar from '@/pages/com/bar';
  export default {
    // components: {
    //   bar
    // },
    data() {
      return {
        baseUrl: uni.gRequest.file,
        articleList1: []
      }
    },
    props: {
      articleList: Object
    },
    watch: {
      async articleList() {
        this.articleList1 = this.articleList
        this.articleList1.forEach(x => {
          x.title = x.headline;
          x.imgs = x.image.split(',');
        });
      }
    },
    async created() {
      console.log(this.articleList);
      // await this.initData();
      // console.log(777, this.articleList);
    },

    methods: {
      // initData() {
      //   uni.gRequest.get('news/list', {
      //     type: 3
      //   }).then(result => {
      //     console.log('result123', result);
      //     this.articleList = result.rows;
      //     this.articleList.forEach(x => {
      //       x.title = x.headline;
      //       x.imgs = x.image.split(',');
      //     });
      //     // console.log(this.articleList)
      //   });
      // },
      newstap(id) {
        console.log(id);
      }
    }
  }
</script>

<style>

</style>
